# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=akonadi-mime
pkgver=23.08.4
pkgrel=0
pkgdesc="Libraries and daemons to implement basic email handling"
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by akonadi
# ppc64le blocked by qt5-qtwebengine -> kaccounts-integration
arch="all !armhf !s390x !riscv64 !ppc64le"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	akonadi-dev>=$pkgver
	kcodecs5-dev
	kconfigwidgets5-dev
	kdbusaddons5-dev
	ki18n5-dev
	kio5-dev
	kitemmodels5-dev
	kmime-dev
	kxmlgui5-dev
	libxslt-dev
	qt5-qtbase-dev
	shared-mime-info
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
_repo_url="https://invent.kde.org/pim/akonadi-mime.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/akonadi-mime-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# mailserializerplugintest is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "mailserializerplugintest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
de28a447f9d1b78b2e5c5d42ca53e8479c9160551545d46cd6d8e79d6a4421cae70a5a8b5e4567eaafa49da1c2c938240b44af6e695a197dd69d178a710fa00a  akonadi-mime-23.08.4.tar.xz
"
